package cn.gdrj.est.service.impl;

import cn.gdrj.est.constants.Constants;
import cn.gdrj.est.dao.MaintainOrderFlowDao;
import cn.gdrj.est.entity.MaintainOrderFlow;
import cn.gdrj.est.service.MaintainOrderFlowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * 维修订单流水业务组件
 *
 * @author jun
 * @date 2021/11/10
 */
@Service
public class MaintainOrderFlowServiceImpl implements MaintainOrderFlowService {
    @Autowired
    private MaintainOrderFlowDao maintainOrderFlowDao;

    /**
     * 保存订单流水记录
     *
     * @param orderFlow
     * @return
     */
    @Override
    public int saveMaintainOrderFlow(MaintainOrderFlow orderFlow) {
        orderFlow.setCreatedTime(new Date());
        orderFlow.setIsDelete(Constants.EST_NOT);
        return maintainOrderFlowDao.insert(orderFlow);
    }
}
